|
|
|
|
|
|
|
For conditional compilation constants, use the prefix cc: |
|
|
|
 |
|
|
|
|
#If ccDEMO Then
' Perform some code here
#End If |
|
|
|
|
|
|
|
|
If you know that a variable will always store data of a particular type, Visual Basic can handle that data more efficiently if you declare the variable of that type. For example, if you need to loop through an array, create an index of the type Integer, not Variant. In other words, avoid the use of Variant unless its absolutely necessary. |
|
|
|
|
|
|
|
|
Function and Procedure Naming |
|
|
|
|
|
|
|
|
Here are some general guidelines to follow when naming your functions and procedures: |
|
|
|
|
|
|
|
|
Use mixed case, where each word in the procedure is capitalized. |
|
|
|
|
|
|
|
|
Preface all functions and procedures with a noun. |
|
|
|
|
|
|
|
|
Follow this noun with the action that will be performed on that noun. |
|
|
|
|
|
|
|
|
Do not use underscores in your function namesthis makes it hard to determine which procedures are yours and which are Visual Basic event procedures. |
|
|
|
|
|
|
|
|
Here are some examples of procedure names that should not be used because the verb comes first: |
|
|
|
|
|